<?php

namespace liketp\event;

use liketp\facade\Event;
use liketp\Log;

class DbSubscribe
{
    public function recordSql(string $sql = '')
    {
        Log::record($sql, 'sql');
    }

    public function subscribe()
    {
        Event::listen('db.record_sql', [get_class($this), 'recordSql']);
    }
}
